package cuongtl.mvc.ex02;

public class Entity {

	private float a;
	private float b;
	private String bientamthoi1;
	private String bientamthoi2;

	// hàm khơi dựng

	public String getBientamthoi1() {
		return bientamthoi1;
	}

	public String getBientamthoi2() {
		return bientamthoi2;
	}

	public void setBientamthoi1(String bientamthoi1) {
		this.bientamthoi1 = bientamthoi1;
	}

	public void setBientamthoi2(String bientamthoi2) {
		this.bientamthoi2 = bientamthoi2;
	}

	public float getA() {
		return a;
	}

	public void setA(float a) {
		this.a = a;
	}

	public float getB() {
		return b;
	}

	public void setB(float b) {
		this.b = b;
	}

	public boolean CheckI() {
		if ((getBientamthoi1().isEmpty() && getBientamthoi2().isEmpty())
				|| getBientamthoi1().isEmpty() || getBientamthoi2().isEmpty()) {
			return false;
		} else {
			a = Float.parseFloat(getBientamthoi1());
			b = Float.parseFloat(getBientamthoi2());
			return true;
		}
	}
}
